package com.qijian.common.utils.poi;

import com.qijian.common.config.QiJianConfig;

import java.io.File;
import java.util.UUID;

public class EasyExcelUtil {

    public static String encodingFilename(String filename) {
        filename = String.format("%s_%s.xlsx", filename, UUID.randomUUID());
        return filename;
    }

    public static String getAbsoluteFile(String filename) {
        String downloadPath = QiJianConfig.getDownloadPath() + filename;
        File desc = new File(downloadPath);
        if (!desc.getParentFile().exists()) {
            desc.getParentFile().mkdirs();
        }
        return downloadPath;
    }
}
